<?xml version="1.0" encoding="ISO_8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:p="http://primefaces.org/ui"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

	<h:head>
	</h:head>
	
	
	<h:body>
	
	<p:growl  showDetail="true" sticky="false" life="3000" />
		<p:panel header="#{msg.componente_title}" id="painel_componentes">
	
			<h:form prependId="false" id="form_componentes">
			
			
			
			
				 <div>
  
				    <p:tree value="#{componentesMB.root}" var="node" id="tree" selectionMode="single" selection="#{componentesMB.selectedNode}" > 
				    
				    <p:ajax event="select" update=":form_componentes:tabela_propriedades"   listener="#{componentesMB.selecionaBusca(componentesMB.selectedNode)}" ></p:ajax>
				     
					        <p:treeNode id="treeNode">  
					            <h:outputText value="#{node}" id="lblNode"/>  
					        </p:treeNode>  
				    </p:tree>  
			
				</div>			
			
		
				<h:panelGrid columns="1" id="coluna_propriedades">
			
			
				
					<h:panelGrid columns="3">
						<p:commandButton value="#{msg.componente_add}" update="conteudo" ajax="false" id="botao_add_componente"  action="#{componentesMB.prepaparaParaCadastrar()}">
							<f:setPropertyActionListener target="#{urlMB.url}" value="cad_componente.xhtml" />
						</p:commandButton>
						<p:commandButton value="#{msg.button_list}" id="botao_lista_componentes" ajax="false"  action="#{testeMB.teste()}" />
						
					</h:panelGrid>
			
				
				
					<p:dataTable id="tabela_propriedades" value="#{componentesMB.caracteristicaComponentes}" var="caracteristicaComponentes" rows="5" emptyMessage="#{msg.componente_empty}" paginator="true">
						
						<p:column headerText="#{msg.componente_codigo}" filterBy="#{caracteristicaComponentes.componente.local.codigo}">
							<h:outputText value="#{caracteristicaComponentes.componente.local.codigo}"/>
						</p:column>	
							
						<p:column headerText="#{msg.componente_nomeColumn}" filterBy="#{caracteristicaComponentes.componente.nome}">														 
							<p:commandLink ajax="false" update="conteudo" action="#{componentesMB.exibiComponente(caracteristicaComponentes.componente)}" value="#{caracteristicaComponentes.componente.nome}">
								<f:setPropertyActionListener target="#{urlMB.url}" value="cad_componente.xhtml" />
								<f:setPropertyActionListener target="#{componentesMB.local}" value="#{caracteristicaComponentes.componente.local}"/>
							</p:commandLink>
						</p:column>		
						
						<p:column headerText="#{componentesMB.caracteristica1Column}" rendered="#{componentesMB.renderCaracteristica1Column}">														 
							<h:outputText value="#{caracteristicaComponentes.caracteristica1}"/>
						</p:column>	
						
						<p:column headerText="#{componentesMB.caracteristica2Column}" rendered="#{componentesMB.renderCaracteristica2Column}">														 
							<h:outputText value="#{caracteristicaComponentes.caracteristica2}"/>
						</p:column>	
						
						<p:column headerText="#{componentesMB.caracteristica3Column}" rendered="#{componentesMB.renderCaracteristica3Column}">														 
							<h:outputText value="#{caracteristicaComponentes.caracteristica3}"/>
						</p:column>	
						
						<p:column headerText="#{componentesMB.caracteristica4Column}" rendered="#{componentesMB.renderCaracteristica4Column}">														 
							<h:outputText value="#{caracteristicaComponentes.caracteristica4}"/>
						</p:column>	
						
						<p:column headerText="#{componentesMB.caracteristica5Column}" rendered="#{componentesMB.renderCaracteristica5Column}">														 
							<h:outputText value="#{caracteristicaComponentes.caracteristica5}"/>
						</p:column>	
						
						<p:column headerText="#{componentesMB.caracteristica6Column}" rendered="#{componentesMB.renderCaracteristica6Column}">														 
							<h:outputText value="#{caracteristicaComponentes.caracteristica6}"/>
						</p:column>			
					
					</p:dataTable>
				</h:panelGrid>			
			
		
			</h:form>
		</p:panel>
			
		
	
	</h:body>

	
</html>